package com.game.action;

import com.coment.game.fight.Attrs;
import com.coment.po.UserDongFu;
import com.game.logic.items.dongFu.UserDongFuService;
import com.game.logic.items.prop.PropService;
import com.game.logic.items.prop.message.UserPropList;
import com.xs.action.annotate.ActionController;
import com.xs.action.annotate.ActionMethod;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/// 12-洞府
@Slf4j
@ActionController(12)
@RestController
@RequestMapping("/UserDongFu")
public class UserDongFuAction {
    @Resource
    private UserDongFuService userDongFuService;

    @Resource
    private PropService propService;

    /// 1.查看洞府
    @ActionMethod(1)
    @GetMapping("/select")
    public UserDongFu select(Integer userInfoId) {
        return userDongFuService.get(userInfoId);
    }

    /// 2.升级洞府
    @ActionMethod(2)
    @GetMapping("/upgrade")
    public Attrs upgrade(Integer userInfoId) {
        return userDongFuService.upgrade(userInfoId);
    }

    /// 3.查看洞府道具列表
    @ActionMethod(3)
    @GetMapping("/list")
    public UserPropList list(Integer userInfoId) {
        return propService.selectAll(userInfoId, 16);
    }
}
